﻿app.controller("ngRentalController", function($scope, $http){
    $scope.rentals;
    $http.get("/api/rental/user/" + $scope.username).success(function (data) {
        $scope.rentals = data;
        console.log(data);
    })
    $scope.collapseRental = function (rental) {
        for (var i in $scope.rental) {
            delete $scope.rental[i].collapseGame;
        }
        if (rental.collapseRental) {
            delete rental.collapseRental;
        } else {
            rental.collapseRental = true;
        };
    };
})